'****************************************************************
'*  Name    : recover.pbp                                       *
'*  Author  : Charles leo                                       *
'*  Notice  : Copyright (c) 2005 microEngineering Labs, inc.    *
'*          : All Rights Reserved                               *
'*  Date    : 4/14/2005                                         *
'*  Version : 1.0                                               *
'*  Notes   : For 12F675 on LAB-X4 EXperimenter board           *
'*          :                                                   *
'****************************************************************

'Run this program in a 12F675 on the LAB-X4 Experimenter Board.  It
'will display gibberish on the LCD until the calibration value is
'incremented to a value that lets the serial communication work.  It
'will continue to display hex calibration values until incremented
'beyond the working range.  Let it run, monitor the LCD for values
'followed by "Correct?".  Pick one of the values that work - midway
'after it starts working and before it stops working.


LCD	Var	GPIO.1		' LCD TX pin

ANSEL = 0	' disable converters
CMCON = 7	' disable comparators

OSCCAL = 0	' starting value

Pause 200  ' give the LCD time to start up

loop:
	OSCCAL = OSCCAL + $10     ' increment calibration value

	' Test to see if the serial comm works.	
	Serout2 LCD,396,[$fe, 1]	' Clear screen
	Serout2 LCD,396,[HEX2 OSCCAL, "   Correct?"]	' Display the hex value  
	
	pause 750	' give time to read the value
	goto loop 	' do it forever

